package bsh;

import org.objectweb.asm.Label;

import bsh.meta.TypeWrapper;

/**
 * Representa uma variavel local
 * 
 * @author takeshi
 */
public class LocalVariable {

    private final int offset;

    private final String name;

    private final TypeWrapper type;

    private final Label start, end;

    /**
     * @param name String
     * @param offset int
     * @param type type
     * @param start label
     * @param end label
     */
    public LocalVariable(String name, int offset, TypeWrapper type, Label start, Label end) {
        super();
        this.start = start;
        this.end = end;
        this.name = name;
        this.offset = offset;
        this.type = type;
    }

    /**
     * @return int
     */
    public int getOffset() {
        return this.offset;
    }

    /**
     * @return string
     */
    public String getName() {
        return this.name;
    }

    /**
     * @return {@link TypeWrapper}
     */
    public TypeWrapper getType() {
        return this.type;
    }

    /**
     * @return label
     */
    public Label getStart() {
        return this.start;
    }

    /**
     * @return label
     */
    public Label getEnd() {
        return this.end;
    }

    /**
     * @return label
     */
    @Override
    public String toString() {
        return "[" + this.name + "," + this.type + "]";
    }

}
